<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
    <el-table v-if="isDisplay === true"
        :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
        @sort-change="onSortChange($event)"  
        :border="isDragendCol"
        :span-method="arraySpanMethod.bind(_self)"
        :highlight-current-row ="isSingleSelect"
        :row-class-name="getRowClassName.bind(_self)"
        :cell-class-name="getCellClassName.bind(_self)"
        size="mini"
        stripe
        rowKey="id"
        :height="tableHeight"
        :treeProps="{children: 'items', hasChildren: 'hasChildren'}"
        @row-click="rowClick($event)"  
        @select-all="selectAll($event)"  
        @select="select($event)"  
        @row-class-name="onRowClassName($event)"  
        @row-dblclick="rowDBLClick($event)"  
        ref='multipleTable' :data="items" :show-header="!isHideHeader">
            <template slot="empty">
                无数据 
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('id')">
                <el-table-column show-overflow-tooltip :prop="'id'" :label="$t('entities.productplan.maininfo_grid.columns.id')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.productplan.maininfo_grid.columns.id')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.id}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('title')">
                <el-table-column show-overflow-tooltip :prop="'title'" :label="$t('entities.productplan.maininfo_grid.columns.title')" :min-width="0"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.productplan.maininfo_grid.columns.title')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
                                  <span><app-column-link
            		deKeyField="productplan"
            		 :context="JSON.parse(JSON.stringify(context))"
            		 :viewparams="JSON.parse(JSON.stringify(viewparams))"
            		 :data="row"
            		 :linkview="{viewname: 'product-plan-main-data-edit-view', height: 0,width: 0,title: $t('entities.productplan.views.maindataeditview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            			{ pathName: 'products', parameterName: 'product' },
            			]
            			,parameters: [
            			{ pathName: 'productplans', parameterName: 'productplan' },
            			{ pathName: 'maindataeditview', parameterName: 'maindataeditview' }
            			]}"
            				valueitem="srfkey">
            <span v-if="row.parent === '-1'">
            	<span title="父计划" style="color: #3c4353;background-color: #ddd;border-radius: 9px;padding: 3px 5px;display: inline-block;line-height: 1;vertical-align: middle">父</span>
            	<span> {{row.title}}</span>
            </span>
            <span v-else-if="row.parent === '0'">
            	<span>{{row.title}}</span>
            </span>
            <span v-else>
            	<span title="子计划" style="color: #3c4353;background-color: #ddd;border-radius: 9px;padding: 3px 5px;display: inline-block;line-height: 1;vertical-align: middle">子</span>
            	<span> {{row.title}}</span>
            </span>
            </app-column-link></span>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('beginstr')">
                <el-table-column show-overflow-tooltip :prop="'beginstr'" :label="$t('entities.productplan.maininfo_grid.columns.beginstr')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.productplan.maininfo_grid.columns.beginstr')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.beginstr}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('endstr')">
                <el-table-column show-overflow-tooltip :prop="'endstr'" :label="$t('entities.productplan.maininfo_grid.columns.endstr')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.productplan.maininfo_grid.columns.endstr')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.endstr}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('storycnt')">
                <el-table-column show-overflow-tooltip :prop="'storycnt'" :label="$t('entities.productplan.maininfo_grid.columns.storycnt')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.productplan.maininfo_grid.columns.storycnt')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.storycnt}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('bugcnt')">
                <el-table-column show-overflow-tooltip :prop="'bugcnt'" :label="$t('entities.productplan.maininfo_grid.columns.bugcnt')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.productplan.maininfo_grid.columns.bugcnt')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.bugcnt}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('actions')">
                <el-table-column :column-key="'actions'" fixed="right" :label="$t('entities.productplan.maininfo_grid.columns.actions')" :width="220"  :align="'center'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.productplan.maininfo_grid.columns.actions')}}
                       </span>
                    </template>
                    <template slot-scope="scope">
                        <template v-if="scope.row.children">
                            <span>
                                <a :title="scope.row.tooltip" @click="loadMore(scope.row)">{{ scope.row.toolcaption }}</a>
                            </span>
                        </template>
                        <div v-else style="text-align: center;">
                            <a v-show="scope.row.AddProject.visible" :disabled="scope.row.AddProject.disabled" @click="uiAction(scope.row, 'AddProject', $event)" :title="$t('entities.productplan.maininfo_grid.uiactions.productplan_addproject')">
                                <i class="fa fa-plus"></i>
                                
                            </a>
                            <divider v-show="scope.row.RelationStory.visible" type="vertical"></divider>
                            <a v-show="scope.row.RelationStory.visible" :disabled="scope.row.RelationStory.disabled" @click="uiAction(scope.row, 'RelationStory', $event)" :title="$t('entities.productplan.maininfo_grid.uiactions.productplan_relationstory')">
                                <i class="fa fa-link"></i>
                                
                            </a>
                            <divider v-show="scope.row.RelationBug.visible" type="vertical"></divider>
                            <a v-show="scope.row.RelationBug.visible" :disabled="scope.row.RelationBug.disabled" @click="uiAction(scope.row, 'RelationBug', $event)" :title="$t('entities.productplan.maininfo_grid.uiactions.productplan_relationbug')">
                                <i class="fa fa-bug"></i>
                                
                            </a>
                            <divider v-show="scope.row.MainEdit.visible" type="vertical"></divider>
                            <a v-show="scope.row.MainEdit.visible" :disabled="scope.row.MainEdit.disabled" @click="uiAction(scope.row, 'MainEdit', $event)" :title="$t('entities.productplan.maininfo_grid.uiactions.productplan_mainedit')">
                                <i class="fa fa-edit"></i>
                                
                            </a>
                            <divider v-show="scope.row.NewSubPlan.visible" type="vertical"></divider>
                            <a v-show="scope.row.NewSubPlan.visible" :disabled="scope.row.NewSubPlan.disabled" @click="uiAction(scope.row, 'NewSubPlan', $event)" :title="$t('entities.productplan.maininfo_grid.uiactions.productplan_newsubplan')">
                                <i class="fa fa-sitemap"></i>
                                
                            </a>
                            <divider v-show="scope.row.Copy.visible" type="vertical"></divider>
                            <a v-show="scope.row.Copy.visible" :disabled="scope.row.Copy.disabled" @click="uiAction(scope.row, 'Copy', $event)" :title="$t('entities.productplan.maininfo_grid.uiactions.copy')">
                                <i class="fa fa-copy"></i>
                                
                            </a>
                            <divider v-show="scope.row.Delete.visible" type="vertical"></divider>
                            <a v-show="scope.row.Delete.visible" :disabled="scope.row.Delete.disabled" @click="uiAction(scope.row, 'Delete', $event)" :title="$t('entities.productplan.maininfo_grid.uiactions.productplan_delete')">
                                <i class="fa fa-remove"></i>
                                
                            </a>
                        </div>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
    </el-table>
    <row class='grid-pagination' v-show="items.length > 0">
        <page class='pull-right' @on-change="pageOnChange($event)" 
            @on-page-size-change="onPageSizeChange($event)"
            :transfer="true" :total="totalRecord"
            show-sizer :current="curPage" :page-size="limit"
            :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
            <span>
                <span class="page-column">
                    <poptip transfer placement="top-start">
                        <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                        <div slot="content">
                            <template v-for="col in allColumns">
                                <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                            </template>
                        </div>
                    </poptip>
                </span>
                <span v-if="selections.length > 0" class="batch-toolbar">
                </span>
                <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                <span>
                    {{$t('app.gridpage.show')}}&nbsp;
                    <span>
                        <template v-if="items.length === 1">
                        1
                        </template>
                        <template v-else>
                            <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                        </template>
                    </span>&nbsp;
                    {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                </span>
            </span>
        </page>
    </row>
  </i-form>
</div>